function indices = correct_wrong_frames(dx)
% gives back the corrupt frames based on dx or dy (registration) evaluation

dx = psmooth(dx);
indices = find(abs(dx) > 5*std(dx)); % find outliers

temp2 = zeros(2,length(indices));
temp2(1,1:end-1) = diff(indices) == 1;
temp2(2,2:end) = diff(indices) == 1;
indices = indices(~logical(max(temp2)));
